package com.model;

// Generated 15 f�vr. 2013 15:56:26 by Hibernate Tools 4.0.0

import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * PersonneContact generated by hbm2java
 */
@Entity
@Table(name = "PersonneContact", schema = "dbo", catalog = "CRM")
public class PersonneContact implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private PersonneContactId id;
	private Client client;
	private Personne personne;
	private String intitule;
	private Date dateCreation;
	private Integer estContactPrincipal;

	public PersonneContact() {
	}

	public PersonneContact(PersonneContactId id, Client client,
			Personne personne) {
		this.id = id;
		this.client = client;
		this.personne = personne;
	}

	public PersonneContact(PersonneContactId id, Client client,
			Personne personne, String intitule, Date dateCreation,
			Integer estContactPrincipal) {
		this.id = id;
		this.client = client;
		this.personne = personne;
		this.intitule = intitule;
		this.dateCreation = dateCreation;
		this.estContactPrincipal = estContactPrincipal;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "clientId", column = @Column(name = "clientId", nullable = false)),
			@AttributeOverride(name = "personneId", column = @Column(name = "personneId", nullable = false)) })
	public PersonneContactId getId() {
		return this.id;
	}

	public void setId(PersonneContactId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "clientId", nullable = false, insertable = false, updatable = false)
	public Client getClient() {
		return this.client;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "personneId", nullable = false, insertable = false, updatable = false)
	public Personne getPersonne() {
		return this.personne;
	}

	public void setPersonne(Personne personne) {
		this.personne = personne;
	}

	@Column(name = "intitule", length = 50)
	public String getIntitule() {
		return this.intitule;
	}

	public void setIntitule(String intitule) {
		this.intitule = intitule;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DateCreation", length = 23)
	public Date getDateCreation() {
		return this.dateCreation;
	}

	public void setDateCreation(Date dateCreation) {
		this.dateCreation = dateCreation;
	}

	@Column(name = "estContactPrincipal")
	public Integer getEstContactPrincipal() {
		return this.estContactPrincipal;
	}

	public void setEstContactPrincipal(Integer estContactPrincipal) {
		this.estContactPrincipal = estContactPrincipal;
	}

}
